(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
minus(n__0, Y) → 0
minus(n__s(X), n__s(Y)) → minus(activate(X), activate(Y))
geq(X, n__0) → true
geq(n__0, n__s(Y)) → false
geq(n__s(X), n__s(Y)) → geq(activate(X), activate(Y))
div(0, n__s(Y)) → 0
div(s(X), n__s(Y)) → if(geq(X, activate(Y)), n__s(div(minus(X, activate(Y)), n__s(activate(Y)))), n__0)
if(true, X, Y) → activate(X)
if(false, X, Y) → activate(Y)
0 → n__0
s(X) → n__s(X)
activate(n__0) → 0
activate(n__s(X)) → s(X)
activate(X) → X
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted CpxTRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(n__0, z0) → 0
minus(n__s(z0), n__s(z1)) → minus(activate(z0), activate(z1))
geq(z0, n__0) → true
geq(n__0, n__s(z0)) → false
geq(n__s(z0), n__s(z1)) → geq(activate(z0), activate(z1))
div(0, n__s(z0)) → 0
div(s(z0), n__s(z1)) → if(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
0 → n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
Tuples:
MINUS(n__0, z0) → c(0')
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
DIV(0, n__s(z0)) → c5(0')
DIV(s(z0), n__s(z1)) → c6(IF(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0), GEQ(z0, activate(z1)), ACTIVATE(z1), DIV(minus(z0, activate(z1)), n__s(activate(z1))), MINUS(z0, activate(z1)), ACTIVATE(z1), ACTIVATE(z1))
IF(true, z0, z1) → c7(ACTIVATE(z0))
IF(false, z0, z1) → c8(ACTIVATE(z1))
ACTIVATE(n__0) → c11(0')
ACTIVATE(n__s(z0)) → c12(S(z0))
S tuples:
MINUS(n__0, z0) → c(0')
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
DIV(0, n__s(z0)) → c5(0')
DIV(s(z0), n__s(z1)) → c6(IF(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0), GEQ(z0, activate(z1)), ACTIVATE(z1), DIV(minus(z0, activate(z1)), n__s(activate(z1))), MINUS(z0, activate(z1)), ACTIVATE(z1), ACTIVATE(z1))
IF(true, z0, z1) → c7(ACTIVATE(z0))
IF(false, z0, z1) → c8(ACTIVATE(z1))
ACTIVATE(n__0) → c11(0')
ACTIVATE(n__s(z0)) → c12(S(z0))
K tuples:none
Defined Rule Symbols:
minus, geq, div, if, 0, s, activate
Defined Pair Symbols:
MINUS, GEQ, DIV, IF, ACTIVATE
Compound Symbols:
c, c1, c4, c5, c6, c7, c8, c11, c12
(3) CdtUnreachableProof (EQUIVALENT transformation)
The following tuples could be removed as they are not reachable from basic start terms:
DIV(0, n__s(z0)) → c5(0')
DIV(s(z0), n__s(z1)) → c6(IF(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0), GEQ(z0, activate(z1)), ACTIVATE(z1), DIV(minus(z0, activate(z1)), n__s(activate(z1))), MINUS(z0, activate(z1)), ACTIVATE(z1), ACTIVATE(z1))
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(n__0, z0) → 0
minus(n__s(z0), n__s(z1)) → minus(activate(z0), activate(z1))
geq(z0, n__0) → true
geq(n__0, n__s(z0)) → false
geq(n__s(z0), n__s(z1)) → geq(activate(z0), activate(z1))
div(0, n__s(z0)) → 0
div(s(z0), n__s(z1)) → if(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
0 → n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
Tuples:
MINUS(n__0, z0) → c(0')
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
IF(true, z0, z1) → c7(ACTIVATE(z0))
IF(false, z0, z1) → c8(ACTIVATE(z1))
ACTIVATE(n__0) → c11(0')
ACTIVATE(n__s(z0)) → c12(S(z0))
S tuples:
MINUS(n__0, z0) → c(0')
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
IF(true, z0, z1) → c7(ACTIVATE(z0))
IF(false, z0, z1) → c8(ACTIVATE(z1))
ACTIVATE(n__0) → c11(0')
ACTIVATE(n__s(z0)) → c12(S(z0))
K tuples:none
Defined Rule Symbols:
minus, geq, div, if, 0, s, activate
Defined Pair Symbols:
MINUS, GEQ, IF, ACTIVATE
Compound Symbols:
c, c1, c4, c7, c8, c11, c12
(5) CdtGraphRemoveDanglingProof (ComplexityIfPolyImplication transformation)
Removed 5 of 7 dangling nodes:
MINUS(n__0, z0) → c(0')
IF(true, z0, z1) → c7(ACTIVATE(z0))
IF(false, z0, z1) → c8(ACTIVATE(z1))
ACTIVATE(n__0) → c11(0')
ACTIVATE(n__s(z0)) → c12(S(z0))
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(n__0, z0) → 0
minus(n__s(z0), n__s(z1)) → minus(activate(z0), activate(z1))
geq(z0, n__0) → true
geq(n__0, n__s(z0)) → false
geq(n__s(z0), n__s(z1)) → geq(activate(z0), activate(z1))
div(0, n__s(z0)) → 0
div(s(z0), n__s(z1)) → if(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
0 → n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
Tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
S tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)), ACTIVATE(z0), ACTIVATE(z1))
K tuples:none
Defined Rule Symbols:
minus, geq, div, if, 0, s, activate
Defined Pair Symbols:
MINUS, GEQ
Compound Symbols:
c1, c4
(7) CdtGraphRemoveTrailingProof (BOTH BOUNDS(ID, ID) transformation)
Removed 4 trailing tuple parts
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(n__0, z0) → 0
minus(n__s(z0), n__s(z1)) → minus(activate(z0), activate(z1))
geq(z0, n__0) → true
geq(n__0, n__s(z0)) → false
geq(n__s(z0), n__s(z1)) → geq(activate(z0), activate(z1))
div(0, n__s(z0)) → 0
div(s(z0), n__s(z1)) → if(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
0 → n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
Tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
S tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
K tuples:none
Defined Rule Symbols:
minus, geq, div, if, 0, s, activate
Defined Pair Symbols:
MINUS, GEQ
Compound Symbols:
c1, c4
(9) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
We considered the (Usable) Rules:
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
s(z0) → n__s(z0)
0 → n__0
And the Tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [4]
POL(GEQ(x1, x2)) = 0
POL(MINUS(x1, x2)) = x2
POL(activate(x1)) = [1] + x1
POL(c1(x1)) = x1
POL(c4(x1)) = x1
POL(n__0) = [3]
POL(n__s(x1)) = [2] + x1
POL(s(x1)) = [2] + x1
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(n__0, z0) → 0
minus(n__s(z0), n__s(z1)) → minus(activate(z0), activate(z1))
geq(z0, n__0) → true
geq(n__0, n__s(z0)) → false
geq(n__s(z0), n__s(z1)) → geq(activate(z0), activate(z1))
div(0, n__s(z0)) → 0
div(s(z0), n__s(z1)) → if(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
0 → n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
Tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
S tuples:
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
K tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
Defined Rule Symbols:
minus, geq, div, if, 0, s, activate
Defined Pair Symbols:
MINUS, GEQ
Compound Symbols:
c1, c4
(11) CdtPolyRedPairProof (UPPER BOUND (ADD(O(n^1))) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
We considered the (Usable) Rules:
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
s(z0) → n__s(z0)
0 → n__0
And the Tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(GEQ(x1, x2)) = [4]x1
POL(MINUS(x1, x2)) = [2]x1
POL(activate(x1)) = x1
POL(c1(x1)) = x1
POL(c4(x1)) = x1
POL(n__0) = 0
POL(n__s(x1)) = [2] + x1
POL(s(x1)) = [2] + x1
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:
minus(n__0, z0) → 0
minus(n__s(z0), n__s(z1)) → minus(activate(z0), activate(z1))
geq(z0, n__0) → true
geq(n__0, n__s(z0)) → false
geq(n__s(z0), n__s(z1)) → geq(activate(z0), activate(z1))
div(0, n__s(z0)) → 0
div(s(z0), n__s(z1)) → if(geq(z0, activate(z1)), n__s(div(minus(z0, activate(z1)), n__s(activate(z1)))), n__0)
if(true, z0, z1) → activate(z0)
if(false, z0, z1) → activate(z1)
0 → n__0
s(z0) → n__s(z0)
activate(n__0) → 0
activate(n__s(z0)) → s(z0)
activate(z0) → z0
Tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
S tuples:none
K tuples:
MINUS(n__s(z0), n__s(z1)) → c1(MINUS(activate(z0), activate(z1)))
GEQ(n__s(z0), n__s(z1)) → c4(GEQ(activate(z0), activate(z1)))
Defined Rule Symbols:
minus, geq, div, if, 0, s, activate
Defined Pair Symbols:
MINUS, GEQ
Compound Symbols:
c1, c4
(13) SIsEmptyProof (EQUIVALENT transformation)
The set S is empty
(14) BOUNDS(O(1), O(1))